* Amiga terminal interface created by Olaf `Olsen' Barthel, send
* complaints and bug reports to:
*
* Olaf `Olsen' Barthel
* Brabeckstrasse 35
* D-3000 Hannover 71
*
* Federal Republic of Germany
*
* EMail: olsen@sourcery.mxm.sub.org
*
* This interface has been designed to work on any Amiga machine running
* Kickstart 1.2 or higher. Unlike the original Infocom interpreter
* interfaces, it supports command-line history (20 lines are standard,
* the value can be changed at compile-time) and command-line editing.
* Editing functions are as follows:
*
* - Backspace
*
* Deletes the character to the left of the cursor.
*
* - Shift + Backspace
*
* Deletes everything from the cursor backward to the start of the line.
*
* - Delete
*
* Deletes the character under the cursor.
*
* - Shift + Delete
*
* Deletes everything from the cursor forward to the end of the line.
*
* - Control + X
*
* Deletes the entire line contents.
*
* - Control + \
*
* Closes the window.
*
* - Control + A
*
* Moves the cursor to the start of the line.
*
* - Control + Z
*
* Moves the cursor to the end of the line.
*
* - Control + W
*
* Deletes the word to the left of the cursor.
*
* - Control + K
*
* Deletes everything from the cursor forward to the end of the line.
*
* - Control + U
*
* Deletes everything from the cursor backward to the start of the line.
*
* - Control + C
*
* Remembers current input line contents.
*
* - Control + Y
*
* Undoes previous editing operation.
*
* - Cursor up
*
* Recalls previous history line.
*
* - Shift + Cursor up
*
* Recalls first history line.
*
* - Cursor down
*
* Moves to next history line.
*
* - Shift + Cursor down
*
* Moves to last history line.
*
* - Cursor right
*
* Moves the cursor to the right.
*
* - Shift + Cursor right
*
* Moves the cursor to the end of the line.
*
* - Cursor left
*
* Moves the cursor to the left.
*
* - Shift + Cursor left
*
* Moves the cursor to the beginning of the line.
*
* - Help
*
* Starts function key assignment. Press the function key you wish to
* assign text to, then enter the text you wish to use. The vertical
* bar (|) and exclamation mark (!) serve as line terminators and will
* produce a carriage-return when the key assigment is recalled.
*
* - F1-F10, Shift + F1-F10
*
* Recalls function key assignment.
*
* - Numeric keypad
*
* Produces movement commands.
*
* As for tool and project icons the following tool type entries are
* supported. Note that due to a bug in icon.library v1.2 and v1.3 the
* single line tool types such as "CUSTOMSCREEN" will have to be followed
* by a `=' character (e.g. "CUSTOMSCREEN=").
*
* - FILETYPE
*
* This is where you or the interpreter places the type of the
* corresponding file. For saved game files this will be
* "FILETYPE=BOOKMARK|ITF", for story files "FILETYPE=STORY" and for
* transcript files "FILETYPE=TEXT|ASCII".
*
* - CUSTOMSCREEN
*
* Corresponds to the "-C" command-line option, i.e. the output window
* will be opened on a custom screen rather than on the Workbench
* screen. The screen will inherit attributes such as depth, colours,
* size and display mode from the Workbench screen. The only
* difference is the handling of A2024 screen modes, which will cause
* the screen to open in hires-interlaced display mode.
* If running under operating system revisions previous to v2.04 a
* monochrome display with the background and text colours set to black
* and white will be opened.
*
* - TEXTFONT
*
* Corresponds to the "-F" option, i.e. determines the text rendering
* font to be used. This will be a disk-resident proportional-spaced
* font. If this option is specified "LISTFONT" and "FONTSIZE" have to
* be included as well. To use the Adobe Times font, use
* "TEXTFONT=Times".
*
* - LISTFONT
*
* Corresponds to the "-L" option, i.e. determines the list and table
* rendering font to be used. This will be a disk-resident fixed-width
* font. If this option is specified "TEXTFONT" and "FONTSIZE" have to
* be included as well. To use the Adobe Courier font, use
* "LISTFONT=Courier".
*
* - FONTSIZE
*
* Corresponds to the "-S" option, i.e. the point size of the text and
* list fonts specified using the "TEXTFONT" and "LISTFONT" tool types.
* To use point size 11, use "FONTSIZE=11".
*
* - STORY
*
* This tool type entry determines the story file to be used.
* Typically, it is saved in the project icon of a saved game file. In
* order to use "Work:Infocom/ZorkIII/Story.Data" as a story file,
* enter the following text: "STORY=Work:Infocom/ZorkIII/Story.Data".
*
* - ATTRIBUTEASSIGNMENTS
*
* Corresponds to the "-a" command-line option.
*
* - ATTRIBUTETESTS
*
* Corresponds to the "-A" command-line option.
*
* - CONTEXT
*
* Corresponds to the "-c" command-line option. In order to use two
* lines of inter-page context, use "CONTEXT=2".
*
* - ECHO
*
* Corresponds to the "-e" command-line option.
*
* - INDENT
*
* Corresponds to the "-i" command-line option. In order to use two
* characters of line indent, use "INDENT=2".
*
* - MARGIN
*
* Corresponds to the "-m" command-line option. In order to use two
* characters as a line margin, use "MARGIN=2".
*
* - NOPAGER
*
* Corresponds to the "-p" command-line option.
*
* - PROMPT
*
* Corresponds to the "-P" command-line option.
*
* - NOSTATUS
*
* Corresponds to the "-s" command-line option.
*
* - TRANSFERS
*
* Corresponds to the "-t" command-line option.
*
* - TANDY
*
* Corresponds to the "-T" command-line option.
*
* This interpreter supports proportional fonts: by default the
* Workbench screen font will be used for text display (this can be
* overridden using the "TEXTFONT", "LISTFONT" and "FONTSIZE" tool
* types). If the Workbench screen font and the system font do not match
* in height the system font will be used for text display. This is due
* to the fact that the interpreter contains conditional code which
* changes the type of the font during the game if tables or maps are to
* be displayed.
*
* If you want the interpreter to save icons with saved game files make
* sure that the icon file "Icon.Data" is present in the directory from
* which the interpreter was loaded or saved game files will be created
* without getting icons attached.
* The interpreter recognizes saved game files by their filetype
* entries, i.e. the tooltype "FILETYPE=BOOKMARK" has to be present.
* Function key assignments, the name of the story file being used and
* game options are saved along with the game file icon. Function key
* assignments are restored automatically when a saved game file is
* loaded. Story file name and options are considered only if the
* interpreter is invoked by double-clicking on a project icon.
*
*
* The following list of features is valid only for Kickstart 2.04 or
* higher. Users whose machines run Kickstart 1.2 or 1.3 will have to
* get along with a slightly simplified interface.
*
* - Several options and commands can be changed via pull-down menus.
* Game files can be restored by dropping their icons on the
* interpreter window.
*
* - If run from Workbench with no story file available the interface
* will check the "Infocom:" assignment or volume if present. If it
* cannot be found a file requester will allow you to select the game
* file to use. If present the "Infocom:" volume or assignment will be
* scanned for valid type 3 Infocom game files. If more than one valid
* game file is found a list will be displayed to choose from.
*
* - The interface also supports multi-volume assignments, so you can
* assign "Infocom:" to multiple directories the interface is to scan.
* One example how to use it would be to copy the "Lost Treasures of
* Infocom" to your hard disk and then use the "Assign Infocom: <Game
* directory> Add" command for each game file directory.
*
*
* Some things which you might want to know about:
*
* - Clipboard support has been implemented in so far as it is possible
* to paste the contents of the clipboard, but there is no option to
* copy the screen text to the clipboard. This may follow in a future
* release version since it requires a good lot of work. Paste
* operations are limited to a single line of input, any additional
* text is discarded. Line feeds are automatically converted into
* carriage returns. Any non-printable characters are filtered out
* while reading.
*
* - As of this writing, the interface ignores any page length settings.
*
* - If a fixed text window is displayed (such as by `Seastalker') the
* status line will be enabled by default. If the fixed text window is
* disabled again the interface will pay attention to the user-defined
* settings.
*
* - Due to the current implementation of pull-down-menu support,
* drag-selection and multiple-selection are not supported.
*
* Please refer to the `COPYING' file for distribution conditions and to
* the `pinfo.txt' file for a general list of features and command-line
* options.
*
*
* In order to compile this program an ANSI compliant `C' compiler is
* required. I recommend using the GNU `C' compiler which I also used
* for development.
*
* May the source be with you,
* -olsen
*/
#ifndef _AMIGA_GLOBAL_H
#include "amiga_global.h"
#endif /* !_AMIGA_GLOBAL_H */
/* Disable ^C trapping for several Amiga `C' compilers. */
#ifdef LATTICE
ULONG CXBRK(VOID) { return(0); }
#endif /* LATTICE */
#ifdef AZTEC_C
long Chk_Abort(VOID) { return(0); }
#endif /* AZTEC_C */
/*
* Global Variables
*/
/*
* Variable: scr_usage
*
* Description:
* This variable should contain a usage string for any extra
* command-line options available through this terminal
* interface.
*/
const char *scr_usage = "[-C] [-L list font name] [-F text font name] [-S font point size]";
/*
* Variable: scr_long_usage
*
* Description:
* This variable should contain a more verbose usage string
* detailing the command-line options available through this
* terminal interface, one option per line.
*/
const char *scr_long_usage = "\t-C\topen custom screen\n\t-L name\tset name of list font\n\t-F name\tset name of text font\n\t-S #\tset font point size\n";
/*
* Variable: scr_opt_list
*
* Description:
* This variable should contain a getopt(3)-style option list for
* any command-line options available through this terminal
* interface.
*/
const char *scr_opt_list = "CL:F:S:";
/*
* Function: scr_cmdarg()
*
* Arguments:
* argc number of original arguments
* argvp pointer to array of strings containing args
*
* Returns:
* Number of new arguments.
*
* Description:
* This function is called before any command line parsing is
* done. Any terminal interface-specific arguments should be
* pulled out of the argv list and any extra arguments obtained
* from resource files or wherever should be added. Note that
* (*argvp)[0] must be the command name and (*argvp)[argc] must